import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class App2 {
    public static void main(String[] args) {
        //1.得到Spring上下文对象
        BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("spring-config.xml"));
        //2.从Spring容器中获取bean对象(方法一)
        Student student = (Student) beanFactory.getBean("student");
        //3.使用bean;
        student.test();
    }
}
